package com.tony.scheduler.server;

import org.apache.log4j.Logger;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;

public class SchedulerHandler extends IoHandlerAdapter {

    public static final Logger logger = Logger.getLogger("engine.log");

    @Override
    public void sessionCreated(IoSession session) throws Exception {
        if (logger.isInfoEnabled()) {
            logger.info("session create , from " + session.getRemoteAddress().toString());
        }
    }

    @Override
    public void sessionClosed(IoSession session) throws Exception {
        super.sessionClosed(session);
    }

    @Override
    public void messageReceived(IoSession session, Object message) throws Exception {
        if (logger.isInfoEnabled()) {
            logger.info("session received , content=" + message.toString());
        }
    }

}
